﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TemplateTree_Right.aspx.cs"
    Inherits="ReportTemplate_TemplateTree_Right" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="../css/css.css" type="text/css" />

    <script src="../JS/jquery.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
        function clickdelete() {
            if (confirm("你确定要删除该条记录吗？")) {
                var btn = document.getElementById("btnDelete");
                if (btn != null)
                    btn.click();
            }
            else
                return false;
        }
        function additems() {
            if ($.trim($("#txtslt").val()) != "") {
                var itme = $.trim($("#txtslt").val());
                $("<option value='" + itme + "'>" + itme + "</option>").appendTo("#sltConent");
            }
        }
        function delitems() {
            var length = form1.sltConent.options.length - 1;
            for (var i = length; i >= 0; i--) {
                if (form1.sltConent[i].selected == true) {
                    form1.sltConent.options[i] = null;
                }
            }
        }
        function addfield() {
            $("#sltConent option").each(function() {
                $("#hidContent").val($("#hidContent").val() + $(this).val() + ",");
            });
            $("#btnSave").click();

        }
        function sltchange(id) {
            if (id == "4")
                $("#slttr").css("display", "");
            else
                $("#slttr").css("display", "none");
        }
    </script>

</head>
<body style="background-image: url('../images/hit_bg.gif');">
    <form id="form1" runat="server">
    <table style="text-align: center">
        <tr>
            <td align="right">
                操作类型：
            </td>
            <td align="left" colspan="2">
                &nbsp;<label runat="server" id="labEdit"></label>
            </td>
        </tr>
        <tr>
            <td align="right">
                <label id="labName" runat="server">
                    字段名：</label>
            </td>
            <td align="left" colspan="2">
                &nbsp;<input id="txtFieldName" runat="server" style="width: 150px;" type="text" />
            </td>
        </tr>
        <tr>
            <td align="right">
                别名：
            </td>
            <td align="left" colspan="2">
                &nbsp;<input id="txtAlias" runat="server" style="width: 150px;" type="text" />
            </td>
        </tr>
        <div id="sltField" runat="server">
            <tr>
                <td align="right">
                    字段类型：
                </td>
                <td align="left" colspan="2">
                    &nbsp;<select id="sltFieldType" style="width: 150px;" onchange="sltchange(this.value)"
                        runat="server">
                        <option value="0">请选择...</option>
                        <option value="1">数字型</option>
                        <option value="2">字符型</option>
                        <option value="3">日期型</option>
                        <option value="4">列表型</option>
                    </select>
                </td>
            </tr>
            <tr id="slttr" runat="server" style="display: none;">
                <td align="right">
                    列表项：
                </td>
                <td align="left">
                    &nbsp;<select id="sltConent" style="width: 150px;" runat="server" size="10">
                    </select>
                </td>
                <td align="left">
                    <input id="txtslt" type="text" /><br />
                    <input id="btnItemAdd" type="button" class="botton02" onclick="additems()" value="增加项" />
                    <input id="btnItemDel" class="botton02" type="button" value="删除项" onclick="delitems()" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    Excel单元格：
                </td>
                <td align="left" colspan="2">
                    &nbsp;<input id="txtFieldExcel" runat="server" style="width: 150px;" type="text" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    排序号：
                </td>
                <td align="left" colspan="2">
                    &nbsp;<input id="txtNumber" runat="server" style="width: 150px;" type="text" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    备注：
                </td>
                <td align="left" colspan="2">
                    &nbsp;<textarea id="taRemark" cols="20" rows="4" runat="server"></textarea>
                </td>
            </tr>
        </div>
        <td colspan="2" align="center">
            <asp:Button ID="btnAdd" runat="server" CssClass="botton02" Text="增加" OnClick="btnAdd_Click" />&nbsp;&nbsp;
            <asp:Button ID="btnEdit" runat="server" CssClass="botton02" Text="修改" OnClick="btnEdit_Click" />&nbsp;&nbsp;
            <input id="btnDel" type="button" class="botton02" runat="server" value="删除" onclick="clickdelete()" />
            <asp:Button ID="btnDelete" runat="server" CssClass="botton02" Height="0px" Width="0px"
                Text="删除" OnClick="btnDelete_Click" />&nbsp;&nbsp;
            <asp:Button ID="btnTemplate" runat="server" CssClass="botton04" Visible="false" Text="生成数据表"
                OnClick="btnTemplate_Click" />
            <input id="btnhtmlsave" class="botton02" runat="server" type="button" value="保存" />
            <asp:Button ID="btnSave" runat="server" CssClass="botton02" Text="保存服务端" Height="0px"
                Width="0px" OnClick="btnSave_Click" />&nbsp;&nbsp;
            <asp:Button ID="btnCancel" runat="server" CssClass="botton02" Text="取消" Visible="false"
                OnClick="btnCancel_Click" />
            <input id="hidOperation" runat="server" type="hidden" />
            <input id="hidParent" runat="server" type="hidden" />
            <input id="hidContent" runat="server" type="hidden" />
        </td>
    </table>
    </form>
</body>
</html>
